const _import =
  process.env.NODE_ENV === 'production'
    ? (file) => () => import('@/views/modules/' + file + '.vue')
    : (file) => require('@/views/modules/' + file + '.vue').default

export default [
  {
    path: 'blog',
    component: _import('blog/index/blog'),
    name: 'blog',
    redirect: { name: 'blog-content' },
    meta: { title: '博客主页' },
    children: [
      {
        path: 'index',
        component: _import('blog/index/blog-content-item'),
        name: 'blog-content',
        meta: { title: '博客' }
      },
      {
        path: 'search',
        component: _import('blog/search/search'),
        name: 'blog-search',
        meta: { title: '博客搜索', noSearch: true }
      },
      {
        path: 'column/:id',
        component: _import('blog/column/column'),
        name: 'blog-column',
        meta: { title: '博客专栏' }
      },
      {
        path: 'details/:id',
        component: _import('blog/details/details'),
        name: 'blog-details',
        meta: { title: '博客内容', catalogue: true, record: true }
      }
    ]
  },
  {
    path: 'blog/create',
    component: _import('blog/create/create'),
    name: 'blog-create',
    meta: { title: '创建博客', noNav: true }
  }
]
